<?php
@include('include/common.inc.php');	

/************Search的cookie*********************/
$Cookie_5 = $_COOKIE['Cookie_5_Id'];
if(empty($Cookie_5))
{
	$Cookie_5= 0;
}else{
	$cookie5 = explode(',',$Cookie_5);
	$count5 = count($cookie5);
	if($count5>4)
	{
			$Cookie_5 = $cookie5[0].','.$cookie5[1].','.$cookie5[2].','.$cookie5[3].','.$cookie5[4];
	}elseif($count5==4){
			$Cookie_5 = $cookie5[0].','.$cookie5[1].','.$cookie5[2].','.$cookie5[3];
	}elseif($count5==3){
			$Cookie_5 = $cookie5[0].','.$cookie5[1].','.$cookie5[2];
	}elseif($count5==2){
			$Cookie_5 = $cookie5[0].','.$cookie5[1];
	}elseif($count5==1){
			$Cookie_5 = $cookie5[0];
	}
}
$sql_Cookie_5 = "select * from $TBL_HOUSE where id in($Cookie_5) limit 5";   
$res_Cookie_5 =$db->query($sql_Cookie_5);
while($rows = $db->fetch_array($res_Cookie_5))
{
	if($rows['hou_type']==1)
	{
		$rows['titlex'] ='租金';
	}elseif($rows['hou_type']==2){
		$rows['titlex'] ='賣價';
	}else{
		$rows['titlex'] ='賣價';
	}
	$rows['ADDR']=FSubstr(str_replace("&nbsp;","",strip_tags($rows[address])),0,20);
	$rows['TIT']=FSubstr(str_replace("&nbsp;","",strip_tags($rows[title])),0,26);
	$row1[]=$rows;
}
/*********************************/


//cookie
$smarty->assign("row1",$row1);
@include('number.php');//验证码
$smarty->display('search.html');
?>